Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci, make: "lint" (flake8 & mypy) replace "quality" #2502

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

Exirel
Copy link
Contributor

@Exirel Exirel commented Aug 12, 2023

Description

I think Sopel 8.0 is ready to enforce type check (close #2461).

I know I did that, so I'm owning my mistake, and rename "make quality" by "make lint". A linter is something that checks your code for errors, and both flake8 and mypy are linters.

There are now 2 new make commands:

  • make lint-style: perform any code style check (today: flake8 only), it could be used for a pylint check for example, or isort, or rst check, or anything that could help us with code style in the future
  • make lint-type: perform any type check (today: mypy only)

The command quality is replaced by the command lint, which runs both lint-style and lint-type.

Type check is now mandatory in CI, and the PR template has been updated accordingly.

Note

I used the kebab-case style for the lint sub-commands, while other sub-commands use the snake_case. We can either switch all to kebab-case (my preferred style for command), or I keep it to snake_case. I have a preferred option, however for the sake of consistency, I'll be happy to revert that if there is an objection.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
  • I have tested the functionality of the things this change touches

I know I did that, so I'm owning my mistake, and rename "make quality"
by "make lint". A linter is something that checks your code for errors,
and both flake8 and mypy are linters.

There are now 2 new make commands:

* make lint-style: perform any code style check (today: flake8 only),
  it could be used for a pylint check for example, or isort, or rst
  check, or anything that could help us with code style in the future
* make lint-type: perform any type check (today: mypy only)

The command `quality` is replaced by the command `lint`, which runs both
`lint-style` and `lint-type`.

Type check is now mandatory in CI, and the PR template has been updated
accordingly.
@Exirel Exirel added this to the 8.0.0 milestone Aug 12, 2023
Copy link
Contributor

@SnoopJ SnoopJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If you want to also include an update to the contributed tox config, here's a diff for that:

click for diff
diff --git a/contrib/tox.ini b/contrib/tox.ini
index 393de027..391d8b11 100644
--- a/contrib/tox.ini
+++ b/contrib/tox.ini
@@ -6,8 +6,7 @@ envlist =
 skip_missing_interpreters = true
 ignore_base_python_conflict = true
 labels =
-    mypy = py{37,38,39,310,311}-mypy
-    quality = py{37,38,39,310,311}-quality
+    lint = py{37,38,39,310,311}-lint
     test = py{37,38,39,310,311}-test
 
 
@@ -39,8 +38,7 @@ setenv =
 
 commands =
     qa: make -C.. qa
-    mypy: make -C.. mypy
-    quality: make -C.. quality
+    lint: make -C.. lint
     test: make -C.. test

(Upon review, I don't think it's worth splitting the two forms of linting for the sake of tox, so I just collapsed them into one label)

I approve of the new naming 😁

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With @SnoopJ's patch to contrib/tox.ini applied, no other uses of the old make label remain (according to grep -r --exclude-dir='.[^.]*' quality .). CI logs show that both flake8 and mypy are run (and passing). 🚀 :shipit:

@Exirel
Copy link
Contributor Author

Exirel commented Aug 16, 2023

Let's go then.

@dgw dgw merged commit bc688b4 into sopel-irc:master Aug 16, 2023
@Exirel Exirel deleted the ci-make-lint-mandatory branch October 12, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollout plan for mypy checks as part of general workflow
3 participants